﻿@using Topro.Entity
@using Topro.Entity.Enum
@using Topro.Entity.Response.Inventory

@model Topro.Entity.PagedList<InventoryQueryResponse>

<div class="data-body data-scroll">
    <div class="data-view">
        <div class="data-div-view table-responsive">
            <table class="table table-hover table-striped table-bordered">
                <thead>
                    <tr>
                        <th class="t_l wd40"></th>
                        <th class="t_l wd150">单据号</th>
                        <th class="t_c wd120">库位</th>
                        <th class="t_l">物料名称</th>
                        <th class="t_c wd110">容器类型</th>
                        <th class="t_c wd110">是否空容器</th>
                        <th class="t_c wd75">剩余库存</th>
                        <th class="t_c wd75">备注</th>
                    </tr>
                </thead>
                <tbody>
                    @if (Model != null && Model.TData != null && Model.TData.Any())
                    {
                        foreach (var item in (List<Topro.Entity.Response.Inventory.InventoryQueryResponse>)Model.TData)
                        {
                            <tr>
                                <td class="t_l"><input type="radio" name="inventoryId" value="@(item.Id)"></td>
                                <td class="t_l">@(item.OrderId)</td>
                                <td class="t_c">@(item.WarehouseUnitId)</td>
                                <td class="t_l">@(item.ProductName)</td>
                                <td class="t_c">
                                    @{ 
                                        if(item.ContainerType == (int)ContainerType.小容器)
                                        {
                                            <span>1Up</span>
                                        }
                                        else if (item.ContainerType == (int)ContainerType.大容器) {
                                            <span>2Up</span>
                                        }
                                        else if (item.ContainerType == (int)ContainerType.铜箔架) {
                                            <span>铜箔架</span>
                                        }
                                    }
                                </td>
                                <td class="t_c">
                                    @{
                                        if (item.IsContainer == (int)IsContainer.实)
                                        {
                                            <input type='checkbox'>
                                        }
                                        else if (item.IsContainer == (int)IsContainer.空)
                                        {
                                            <input type='checkbox' checked>
                                        }
                                    }
                                </td>
                                <td class="t_c">@(item.StockQuantity)</td>
                                <td class="t_l">@(item.Remark)</td>
                            </tr>
                        }
                    }
                    else
                    {
                        <tr>
                            <td colspan="8" class="t_c">暂无记录</td>
                        </tr>
                    }
                </tbody>
            </table>
        </div>
    </div>
</div>
<!-- 必要的分页参数设置 -->
<input type="hidden" id="TotalCount" value="@(Model != null ? Model.TotalCount : 0)" />